import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '流程定义id',
    align: "center",
    dataIndex: 'id'
  },
  {
    title: '流程部署id',
    align: "center",
    dataIndex: 'deploymentId'
  },
  {
    title: '流程名称',
    align: "center",
    sorter: true,
    dataIndex: 'name'
  },
  {
    title: '流程定义key',
    align: "center",
    sorter: true,
    dataIndex: 'processKey'
  },
  {
    title: '流程类别',
    align: "center",
    dataIndex: 'category'
  },
  {
    title: '流程版本',
    align: "center",
    sorter: true,
    dataIndex: 'version'
  },
  {
    title: '资源名称',
    align: "center",
    dataIndex: 'resourceName'
  }, {
    title: '状态',
    align: "center",
    dataIndex: 'isSuspended',
    slots: { customRender: 'procdefState' },
  }
];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "流程key",
    field: 'processKey',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "流程类别",
    field: 'category',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: "act_model_type"
    },
    //colProps: {span: 6},
  },
  {
    label: "是否已暂停",
    field: 'isSuspended',
    component: 'Input',
    //colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '流程部署id',
    field: 'deploymentid',
    component: 'Input',
    dynamicRules: () => {
      return [
        { required: true, message: '请输入流程部署id!' },
      ];
    },
  },
  {
    label: '流程名称',
    field: 'name',
    component: 'Input',
    dynamicRules: () => {
      return [
        { required: true, message: '请输入流程名称!' },
      ];
    },
  },
  {
    label: '流程key',
    field: 'processKey',
    component: 'Input',
    dynamicRules: () => {
      return [
        { required: true, message: '请输入流程key!' },
      ];
    },
  },
  {
    label: '流程类别',
    field: 'category',
    component: 'Input',
    dynamicRules: () => {
      return [
        { required: true, message: '请输入流程类别!' },
      ];
    },
  },
  {
    label: '流程版本',
    field: 'version',
    component: 'Input',
  },
  {
    label: '资源名称',
    field: 'resourceName',
    component: 'Input',
    dynamicRules: () => {
      return [
        { required: true, message: '请输入资源名称!' },
      ];
    },
  },
  {
    label: '图表资源名称',
    field: 'diagramResourceName',
    component: 'Input',
  },
  {
    label: '绑定表单',
    field: 'hasStartFormKey',
    component: 'Input',
  },
  {
    label: '是否已暂停',
    field: 'isSuspended',
    component: 'InputNumber',
    dynamicRules: () => {
      return [
        { required: true, message: '请输入是否已暂停!' },
      ];
    },
  },
  {
    label: '流程描述',
    field: 'description',
    component: 'Input',
  },
  // TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];
